﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class AddResume : System.Web.UI.Page
{
    string rcid;
    string pid;
    string sql;
    AddRe ar = new AddRe();
    protected void Page_Load(object sender, EventArgs e)
    {
        //Session["person"] = "200906201001";
       // MultiView1.SetActiveView(View1)
        //加验证
        Label1.Text = "";
        if (Session["person"] != null)
        {
            pid=Session["person"].ToString();
            if (Request.QueryString["mk"] != null)
            {
                string qs=Request.QueryString["mk"];
                switch (qs)
                {
                    case "1": sql = "select * from tb_intent where pid=" + pid; break;
                    case "2": sql = "select * from tb_workaim where pid=" + pid; break;
                    case "3": sql = "select * from tb_workep where pid=" + pid; break;
                    case "4": sql = "select * from tb_edpg where pid=" + pid; break;
                    case "5": sql = "select * from tb_lang where pid=" + pid; break;
                    case "6": sql = "select * from tb_stuclass where pid=" + pid; break;
                    case "7": sql = "select * from tb_like where pid=" + pid; break;
                    case "8": sql = "select * from tb_appraise where pid=" + pid; break;
                    case "9": sql = "select * from tb_certificate where pid=" + pid; break;
                    case "10": sql = "select * from tb_remark where pid=" + pid; break;
                }
                if (ar.selRe(sql))
                {
                    //Response.Write("<center><font color='greed'><h2>不能重复填写！</h2></font></center>");
                    //Response.Write("<center><a href='javascript:history.back();'>返回</a></center>");
                    Label1.Text = "<p><center><font color='#149edd'><h2>不能重复填写！</h2></font></center></p><p><center><a href='Resume.aspx'>返回</a></center></p>";
                }
                else
                {
                    MultiView1.ActiveViewIndex = Convert.ToInt32(qs) - 1;
                }
            }
            else {
                Response.Write("请不要非法进入！");
            }
        }
        else {
            Response.Write("请不要非法进入！");
        }
    }
    protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e)
    {
        //Boolean arg = ar.selRe("select * from tb_intent where pid=" + Session["person"].ToString());
        //if (arg) {
        //    //Label1.Text = "<script>window.close();</script>";
        //}
        //e.Cancel = arg;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        SqlDataSource2.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        SqlDataSource3.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        SqlDataSource4.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        SqlDataSource5.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button9_Click(object sender, EventArgs e)
    {
        SqlDataSource6.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button5_Click(object sender, EventArgs e)
    {
        SqlDataSource8.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button8_Click(object sender, EventArgs e)
    {
        SqlDataSource7.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button6_Click(object sender, EventArgs e)
    {
        SqlDataSource9.Insert();
        Response.Redirect("Resume.aspx");
    }
    protected void Button7_Click(object sender, EventArgs e)
    {
        SqlDataSource10.Insert();
        Response.Redirect("Resume.aspx");
    }
}
